Skip to content

ifconfig-mcp

A ModelContextProtocol (MCP) server that provides IP address and geolocation information tools.

Features

  • Get user's external IP address and location information
  • Get location information for a specific IP address

Installation

bash
npm install ifconfig-mcp

Or install it globally:

bash
npm install -g ifconfig-mcp

Usage

Configure mcp.json

Create an mcp.json file in your project root with the following configuration:

json
{
  "mcpServers": {
    "mcp-ifconfig-me": {
      "command": "npx",
      "args": [
        "-y",
        "ifconfig-mcp"
      ]
    }
  }
}

Available Tools

get_location_ip

Gets the user's external IP address and corresponding geographic location information.

json
{
  "name": "get_location_ip",
  "params": {}
}

get_location_by_ip

Gets location information for a specific IP address using ip-api.com.

json
{
  "name": "get_location_by_ip",
  "params": {
    "ip": "8.8.8.8", // Optional, defaults to current IP if not provided
    "lang": "en" // Optional, defaults to "zh-CN"
  }
}

Available language options: "en", "de", "es", "pt-BR", "fr", "ja", "zh-CN", "ru"

Development

bash
# Install dependencies
npm install

# Build the project
npm run build

# Run in development mode with auto-reloading
npm run dev

# Run with inspector
npm run inspect

License

MIT